<!-- 图片导航 -->
<form onchange="changeForm($(this),12)">
    <input type="hidden" name="model_id" value="12" />
<h2 class="attr-title">图片导航</h2>
<div class="layui-form-item">
    <label class="layui-form-label sm">背景颜色</label>
    <div class="layui-input-block">
        <div class="color-wrapper">
            <input data-js="color" type="text" name="back_color" value="{$config_info.back_color|default=''}" />
        </div>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label sm">展示形式</label>
    <div class="layui-input-block">
        <div class="ds-icon-radio">
            <input type="hidden" name="show_format" value="{$config_info.show_format|default='1'}" />
            <ul class="ds-icon">
                <li{if !isset($config_info['show_format']) || $config_info['show_format']==1} class="ds-icon-active"{/if} data-val="1" onclick="setRadio($(this))">
                    <img src="{$Think.HOME_SITE_ROOT}/images/editable_page/four.png">
                    <div class="text">四列</div>
                </li>
                <li{if isset($config_info['show_format']) && $config_info['show_format']==2} class="ds-icon-active"{/if} data-val="2" onclick="setRadio($(this))">
                    <img src="{$Think.HOME_SITE_ROOT}/images/editable_page/five.png">
                    <div class="text">五列</div>
                </li>
            </ul>
        </div>
    </div>
</div>
{if isset($config_info['nav']) && !empty($config_info['nav'])}
{foreach name='config_info.nav' item='item' key='key'}
<div class="model-item"{if $key==0} id="adv_item"{/if}>
    <div class="layui-form-item">
        <label class="layui-form-label sm">导航图片</label>
        <div class="layui-input-block">
            <div class="uploader-wrapper">
                <div class="uploader-image-wrapper" {if !$item.image}style="display:none" {/if}>
                                        <img class='uploader-image' src='{$item.image|default=""}' />
                                        <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                    </div>
                <div class='uploader-content' {if $item.image}style="display:none" {/if}>
                    <div class="uploader-icon iconfont">&#xe6bf;</div>
                    <div class="uploader-text">点击上传</div>
                    <div class="uploader-notice">60×60</div>
                    <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
                <input type='hidden' name='nav[i_{$key}][image]' value='{$item.image|default=""}'>
                </div>
                
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">导航文字</label>
        <div class="layui-input-block">
            <input type="text" name='nav[i_{$key}][text]' value='{$item.text|default=""}' placeholder="请输入导航文字" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name='nav[i_{$key}][link]' value='{$item.link|default=""}' placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
{/foreach}
{else}
<div class="model-item" id="nav_item">
    <div class="layui-form-item">
        <label class="layui-form-label sm">导航图片</label>
        <div class="layui-input-block">
            <div class="uploader-wrapper">
                <div class="uploader-image-wrapper" style="display:none">
                                        <img class='uploader-image' src='' />
                                        <div class="iconfont uploader-image-btn" onclick="delFile($(this))">&#xe696;</div>
                                    </div>
                <div class='uploader-content'>
                    <div class="uploader-icon iconfont">&#xe6bf;</div>
                    <div class="uploader-text">点击上传</div>
                    <div class="uploader-notice">60×60</div>
                    <input type='file' class='uploader-file' onchange='uploadFile($(this))'>
                <input type='hidden' name='nav[i_0][image]' value=''>
                </div>
                
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">导航文字</label>
        <div class="layui-input-block">
            <input type="text" name='nav[i_0][text]' value='' placeholder="请输入导航文字" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label sm">跳转页面</label>
        <div class="layui-input-block">
            <input type="text" name='nav[i_0][link]' value='' placeholder="请输入跳转页面" class="layui-input">
        </div>
    </div>
</div>
{/if}
<div class="model-btn" onclick="addModel($(this),12)">
    <span>+</span>
    <span>添加一个图片导航</span>
</div>

</form>
<script>
    if(typeof(loadConfig12)=='undefined'){
        function loadConfig12(obj){
            obj.find('[data-js="color"]').colorpicker({showOn: 'both'});
        }
    }
    $(function(){
        if(typeof(index['i_12'])=='undefined'){
            index['i_12']={if isset($config_info['nav'])}{:count($config_info['nav'])}{else}0{/if};
            html['i_12']=$('#nav_item').html()
        }
    })
</script>